Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Export API Errors #1361

Merged
merged 2 commits into from
Jun 13, 2022
Merged

feat: Export API Errors #1361

merged 2 commits into from
Jun 13, 2022

Conversation

tlgimenes
Copy link
Contributor

@tlgimenes tlgimenes commented Jun 10, 2022

What's the purpose of this pull request?

This PR exports some errors we throw inside of @faststore/api so starters can catch these errors and respond accordingly. For instance, starters can respond 404 when a NotFoundError is thrown inside @faststore/api.

Starters Deploy Preview

@tlgimenes tlgimenes requested a review from a team as a code owner June 10, 2022 18:06
@vercel
Copy link

vercel bot commented Jun 10, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
faststore ✅ Ready (Inspect) Visit Preview Jun 10, 2022 at 7:33PM (UTC)

@tlgimenes tlgimenes force-pushed the feat/export-errors branch from 2dab0da to 3d13823 Compare June 10, 2022 18:08
@codesandbox-ci
Copy link

codesandbox-ci bot commented Jun 10, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 5c3ddb2:

Sandbox Source
Store UI Typescript Configuration

Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

In the past, I tested this SKU loader and it's not working as expected.
Maybe it's a good opportunity to change it now.

throw new Error(
`Search API did not return the following skus: ${missingSkus.join(',')}`
throw new NotFoundError(
`Search API did not found the following skus: ${missingSkus.join(',')}`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By the time I tested it, it was not working as expected.

Maybe it's a good opportunity to improve this logic here. What do you think?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NICE! Sure!

@tlgimenes tlgimenes changed the title feat: Export API Errors | WIP feat: Export API Errors Jun 10, 2022
@tlgimenes tlgimenes added enhancement New feature or request store-api labels Jun 10, 2022
Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! It worked as expected.

Screen Shot 2022-06-13 at 12 54 53

@tlgimenes tlgimenes merged commit 853035a into main Jun 13, 2022
@tlgimenes tlgimenes deleted the feat/export-errors branch June 13, 2022 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants